void main() {
  //.. 级联表达式
  var sb = StringBuffer()
    ..write("123")
    ..write("456")
    ..write("789");
  print(sb);

  /**
   * 等价于
   * var sb = StringBuffer();
   * sb.write("123");
   * sb.write("456");
   * sb.write("789");
   */

  /*querySelector('#confirm') // Get an object.
    ?..text = 'Confirm' // Use its members.
    ..classes.add('important')
    ..onClick.listen((e) => window.alert('Confirmed!'))
    ..scrollIntoView();*/

  /**
   * 等价于
   *  var button = querySelector('#confirm');
   *  button?.text = 'Confirm';
   *  button?.classes.add('important');
   *  button?.onClick.listen((e) => window.alert('Confirmed!'));
   *  button?.scrollIntoView();
   */
}
